﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.io.OutputStream"%>
<%@ page import="javax.imageio.ImageIO"%>
<%@ page import="pers.cj.pdos.utils.CaptchaUtil" %>
<%
	CaptchaUtil util = CaptchaUtil.Instance();

	//将生成的验证码存入session
	session.setAttribute(CaptchaUtil.SESSION_CODE_NAME, util.getString());

	//输出图片
	response.setContentType("image/jpeg");
	out.clear();
	out = pageContext.pushBody();
	OutputStream outputStream = response.getOutputStream();
	ImageIO.write(util.getImage(), "jpeg", outputStream);
	outputStream.close();
%>